package com.ruoyi.news.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.news.domain.TakeMoney;
import com.ruoyi.news.mapper.TakeMoneyMapper;
import com.ruoyi.news.service.ITakeMoneyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;


/**
 * 平台收到佣金Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-11-19
 */
@Service
public class TakeMoneyServiceImpl implements ITakeMoneyService
{
    @Autowired
    private TakeMoneyMapper takeMoneyMapper;

    /**
     * 查询平台收到佣金
     * 
     * @param id 平台收到佣金主键
     * @return 平台收到佣金
     */
    @Override
    public TakeMoney selectTakeMoneyById(String id)
    {
        return takeMoneyMapper.selectTakeMoneyById(id);
    }

    @Override
    public TakeMoney selectTakeMoneyBySourceId(String sourceId) {
        return takeMoneyMapper.selectTakeMoneyBySourceId(sourceId);
    }

    /**
     * 查询平台收到佣金列表
     * 
     * @param takeMoney 平台收到佣金
     * @return 平台收到佣金
     */
    @Override
    public List<TakeMoney> selectTakeMoneyList(TakeMoney takeMoney)
    {
        return takeMoneyMapper.selectTakeMoneyList(takeMoney);
    }

    /**
     * 新增平台收到佣金
     * 
     * @param takeMoney 平台收到佣金
     * @return 结果
     */
    @Override
    public int insertTakeMoney(TakeMoney takeMoney)
    {
        takeMoney.setCreateTime(DateUtils.getNowDate());
        return takeMoneyMapper.insertTakeMoney(takeMoney);
    }

    /**
     * 修改平台收到佣金
     * 
     * @param takeMoney 平台收到佣金
     * @return 结果
     */
    @Override
    public int updateTakeMoney(TakeMoney takeMoney)
    {
        takeMoney.setUpdateTime(DateUtils.getNowDate());
        return takeMoneyMapper.updateTakeMoney(takeMoney);
    }

    /**
     * 批量删除平台收到佣金
     * 
     * @param ids 需要删除的平台收到佣金主键
     * @return 结果
     */
    @Override
    public int deleteTakeMoneyByIds(String[] ids)
    {
        return takeMoneyMapper.deleteTakeMoneyByIds(ids);
    }

    /**
     * 删除平台收到佣金信息
     * 
     * @param id 平台收到佣金主键
     * @return 结果
     */
    @Override
    public int deleteTakeMoneyById(String id)
    {
        return takeMoneyMapper.deleteTakeMoneyById(id);
    }
}
